#pragma once

#include "Utilies.h"

namespace vkengine
{
	class Device;
	class Buffers;
	class Texture
	{
	public:
		void CreateTextureImage(Device* device, Buffers* buffer);
		void CreateTextureImageView(VkDevice device);
		void CreateTextureSampler(Device* device);

		VkImageView CreateImageView(VkDevice device, VkImage image, VkFormat format,  VkImageAspectFlags aspectFlags);
		void CreateImage(Device* device, Buffers* buffers, uint32_t width, uint32_t height, VkFormat format, VkImageTiling tiling, VkImageUsageFlags usage, VkMemoryPropertyFlags properties, VkImage& image, VkDeviceMemory& imageMemory);


		void TransitionImageLayout(
			Device* device,
			Buffers* buffers,
			VkImage image,
			VkFormat format,
			VkImageLayout oldLayout,
			VkImageLayout newLayout);

		void CopyBufferToImage(Device* device, Buffers* buffers, VkBuffer buffer, VkImage image, uint32_t width, uint32_t height);
		void Cleanup(VkDevice device);

		VkImageView GetVkImageView() { return m_TextureImageView; }
		VkSampler GetTextureSampler() { return m_TextureSampler; }

	private:
		VkImage m_TextureImage;
		VkDeviceMemory m_TextureImageMemory;
		VkImageView m_TextureImageView;
		VkSampler m_TextureSampler;


	};
}